import 'dart:typed_data';

import 'xf_evaluate_platform_interface.dart';

class XfEvaluate {
  Future<String?> getPlatformVersion() {
    return XfEvaluatePlatform.instance.getPlatformVersion();
  }

  /// 同步配置
  /// [status_bos_timeout] 前置超时时 传递的value
  /// [status_finish] 后置超时
  Future<void> asyncVadConfig(String status_bos_timeout, String status_finish){
    return XfEvaluatePlatform.instance.asyncVadConfig(status_bos_timeout, status_finish);
  }

  /// 注册监听
  Future<void> setVadListener() async {
    return XfEvaluatePlatform.instance.setVadListener();
  }

  /// 销毁监听
  Future<void> destroyVadListener() async {
    return XfEvaluatePlatform.instance.destroyVadListener();
  }

  /// 发送实时流检测
  Future<void> detectVad(Uint8List frame, int len) async {
    return XfEvaluatePlatform.instance.detectVad(frame, len);
  }

  /// 重置
  Future<void> resetVad() async {
    return XfEvaluatePlatform.instance.resetVad();
  }

  /// 添加监听
  void setChannelListener(Function(String method ,dynamic) callback){
    XfEvaluatePlatform.instance.setChannelListener(callback);
  }
}
